
macro(_FIND_OIS_LIBRARY _var)
  find_library(${_var}
     NAMES 
        ${ARGN}
	 HINTS /usr/incl
  )
  mark_as_advanced(${_var})
endmacro()

macro(_OIS_APPEND_LIBRARIES _list _release)
   set(_debug ${_release}_DEBUG)
   if(${_debug})
      set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}})
   else()
      set(${_list} ${${_list}} ${${_release}})
   endif()
endmacro()

find_path(OIS_INCLUDE_DIR OIS.h
		  HINTS /usr/include/OIS)

# Find the libraries

_FIND_OIS_LIBRARY(OIS_STATIC_LIBRARY        OIS)
_FIND_OIS_LIBRARY(OIS_STATIC_LIBRARY_DEBUG  OIS_d)


# handle the QUIETLY and REQUIRED arguments and set OIS_FOUND to TRUE if 
# all listed variables are TRUE
#include("FindPackageHandleStandardArgs.cmake")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OIS DEFAULT_MSG
    OIS_STATIC_LIBRARY OIS_INCLUDE_DIR)

set(OIS_INCLUDE_DIRS ${OIS_INCLUDE_DIR})
if(OIS_FOUND)
   _OIS_APPEND_LIBRARIES(OIS_LIBRARIES OIS_STATIC_LIBRARY)
endif()
